package com.hnqcgczy.supplier.dao;

import com.hnqcgczy.supplier.vo.Company;

import java.sql.SQLException;
import java.util.List;

/**
 * 规定CompanyDao表的CRUD操作
 */
public interface CompanyDao {
    /**
     * 新增供应商-资质信息
     *
     * @param company
     * @return
     * @throws SQLException
     */
    int addCompany(Company company) throws SQLException;

    /**
     * 查询供应商资质信息
     *
     * @param company
     * @param start    索引开始
     * @param pageSize 每页显示多少条
     * @return
     * @throws SQLException
     */
    List<Company> queryByLike(Company company, int start, int pageSize) throws SQLException;

    /**
     * 总记录数
     *
     * @param company
     * @return
     * @throws SQLException
     */
    int queryTotals(Company company) throws SQLException;

    /**
     * 查单个供应商信息
     *
     * @param companyId
     * @return
     * @throws SQLException
     */
    Company findOne(Integer companyId) throws SQLException;

    /**
     * 修改供应商信息
     *
     * @param company
     * @return
     * @throws SQLException
     */
    int update(Company company) throws SQLException;

    /**
     * 通过id删除资质信息
     *
     * @param companyId
     * @return
     * @throws SQLException
     */
    int delete(Integer companyId) throws SQLException;

}
